<!DOCTYPE html>
<!-- ng-app -->
<html lang="en" ng-app="app">
<head>
    <meta charset="UTF-8">
    <title>控制器初始化$scope对象</title>
    <script src="../../../js/plugins/angular/angular.min.js" type="text/javascript"></script>
</head>
<body>
    <div ng-controller="cont">
        <span class="show">{{span_show()}}</span>
    </div>

    <script>
        var app = angular.module('app', []);
        app.controller('cont', ['$scope',function ($scope) {
            $scope.text = 'hello oli~';

            $scope.span_show = function () {
                $scope.text = '欢迎 oli~';
                return $scope.text;
            }
        }]);

    </script>
</body>
</html>